package com.example.s06.entity;

import jakarta.annotation.PostConstruct;
import jakarta.annotation.PreDestroy;
import lombok.Data;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

@Data
@Component
@Scope("prototype")
public class Pear {
    private String name;
    @PostConstruct
    public  void initPear(){
        System.out.println("初始化Pear方法");
    }
    @PreDestroy
    public void destroyPear(){
        System.out.println("销毁Pear方法");
    }
}
